package com.atguigu.gmall;

import com.atguigu.gmall.impl.UserDegradeFeignClient;
import com.atguigu.gmall.user.model.UserAddress;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
@FeignClient(value = "service-user",fallback = UserDegradeFeignClient.class) //服务降级类
public interface UserFeignClient {

    /**
     * 根据指定用户id查询用户地址
     * @param userId
     * @return
     */
    @GetMapping("/api/user/inner/findUserAddressListByUserId/{userId}")
    public List<UserAddress> getUserAddressListByUserId(@PathVariable("userId") Long userId);
}